package com.eastfair.venuebooking.api;

import com.eastfair.core.base.R;
import com.eastfair.venueservice.dto.ServiceProviderUserDTO;
import com.eastfair.venueservice.vo.ServiceProviderUserVO;
import com.eastfair.venueservice.vo.ServiceProviderVO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

/**
 * 服务商用户关系 feign.
 *
 * @author dqq
 * @date 2023 /2/3
 */
@FeignClient(value = "venue-services-manage/serviceProviderUser")
public interface ServiceProviderUserFeign {

    /**
     * 保存服务商，用户关系.
     *
     * @param serviceProviderUserDTO the service provider user dto
     * @return the r
     */
    @PostMapping("/save")
    R<Boolean> save(@RequestBody ServiceProviderUserDTO serviceProviderUserDTO);

    /**
     * 移除用户，服务商关系.
     *
     * @param userId              the user id
     * @param serviceProviderId   the service provider id
     * @param serviceProviderType the service provider type
     * @return the r
     */
    @GetMapping("/delete")
    R<Boolean> remove(@RequestParam("userId") Long userId,
                      @RequestParam("serviceProviderId") Long serviceProviderId,
                      @RequestParam("serviceProviderType") String serviceProviderType);

    /**
     *  cms同步查询服务商用户列表
     * @return
     */
    @GetMapping("/cms/sync")
    R<List<ServiceProviderUserVO>> queryCrmSyncServiceProviderUser();

    /**
     *  cms同步查询服务商用户列表
     * @return
     */
    @PostMapping("/cms/updSync")
    R updForCmsUserSyncupdSync(@RequestBody ServiceProviderUserDTO serviceProviderUserDTO);
}